package applet;

import java.util.*;

import net.HTTPConnection;

import db.DBConnection;

import processing.core.PApplet;
import processing.core.PFont;
import processing.core.PImage;

public class GLOBAL {
	public static final String baseDir = "../data/";

	public static PApplet processing;
	
	public static DBConnection db;

	public static HTTPConnection http;
	
	public static GuiGradient gu;
	public static DynTree relationTree;
	public static int colorBackground;
	public static int colorButtonLabel;
	public static int colorButtonBackground;
	public static int colorLinesLabelY;
	public static int colorButtonActive;
	public static int colorPlotArea;
	public static int colorBlu;
	public static int colorText;
	
	public static PFont tFont, fontTimes12, tFont32;
	public static int defaultMenuWidth = 150;
	
	public static boolean mouseReleased;
	public static boolean mousePressed;
	public static boolean mouseDragged;
	
	public static boolean onDynTree;
	public static boolean draggedToDynTree;
	
	public static CompareRegion[] block;
	public static boolean onCompareRegion;
//	public static boolean draggedToCompareRegion;
	
	public static TabGroup tabs;
	public static MyMap map;

	public static Artist testArtist;
	public static BarChart testBar;
	public static PieChart testPie;
	public static GenderPieChart testGPie;
	public static Artist curArtist;  //used in single mode
	public static ArrayList<ArtistButton> items;
	public static ArrayList<Country> countries_times;
	public static ArrayList<Integer> artistRecommendationsIds;
	
	public static Release curRelease;
	public static Track curTrack;
	public static ArrayList<ReleaseButton> curReleaseButtonsPerArtist; //need query given artist id (use GLOBAL.http)
	public static int curReleaseId=0;
	public static ArrayList<TrackButton> curTrackButtonsPerRelease; //need query given release id (use GLOBAL.http)
	public static int curTrackId=0;
	
	//string used in filter panel
	public static int curCountryId, curAgeId;//-1 means ALL
	public static int prevCountryId, prevAgeId;// before select ALLBUTTON
	public static String curSex,prevSex, curAge;
	public static String curCountry;
	public static ArrayList<FilterButton> countryButtons;
	public static int dataStart = 0;
	public static int dataLimit = 10000;
	
	public static boolean artistsCompare = false;
	public static ArrayList<Artist> artistsCompareList;
	
	public static PImage testImage;
	
	public static boolean showingCountry = false; 
	
	public static ArrayList<WeeklyButton>weeklyButtons;
	
	public static WeeklyDragMenu weeklyMenu;
	
	public static WeeklyData weeklyDataCurrent;
	
	public static PImage weeklyImage;
	
	
	//public static int DEBUGCOUNTER = 0;
	
	public GLOBAL(PApplet p) {
		processing = p;
	}
	
	synchronized public static void addArtist(ArtistButton a){
		items.add(a);
	}
	
	synchronized public static int getItemsSize(){
		return items.size();
		
	}
}
